package creationtype.abstractfactory;
/**
 * 邢帅教育
 * <p>
 * 本源代码由数据中心及其作者共同所有，未经版权持有者的事先书面授权，
 * 不得使用、复制、修改、合并、发布、分发和/或销售本源代码的副本。
 *
 * @copyright Copyright (c) 2018. xsteach.com all rights reserved.
 */

import creationtype.abstractfactory.cup.Cup;
import creationtype.abstractfactory.drink.Drink;

/**
 * @author maikec
 * @date 2018/9/1
 */
public class AbstractFactoryPatternDemo {
    public static void main(String[] args) {
        buyTea();
        System.out.println();
        buyCoffee();
    }

    private static void buyTea() {
        BeverageShop shop = new TeaAbstractFactory();
        Cup teaCup = shop.getCup();
        Drink tea = shop.getDrink();
        System.out.println( teaCup.getColor() );
        System.out.println( tea.getTaste() );
    }

    private static void buyCoffee() {
        BeverageShop shop = new CoffeeAbstractFactory();
        Cup coffeeCup = shop.getCup();
        Drink coffee = shop.getDrink();
        System.out.println( coffeeCup.getColor() );
        System.out.println( coffee.getTaste() );
    }
}
